<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
 <%@taglib uri="/struts-tags" prefix="s"%>
 <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>OA协同办公系统</title>
<link type="text/css" rel="stylesheet" href="css/table.css">
<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="js/openwindow.js"></script>
<script type="text/javascript" src="js/file.js"></script>
<SCRIPT type="text/javascript" src="js/workflow.js"></SCRIPT>
<script src="js/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
		<style type="text/css">
		body,td,th {
			background-color:white;
			font-family: "宋体";
			font-size: 12px;
		}
		</style>
<script type="text/javascript">
$(function(){
	var flowId=$("#flowId").val();
	var param={"flowId":flowId};
	var area=$("textarea");
	for(var i=0;i<area.length;i++){
		$("#"+area[i].id).attr("style","width:550px; height:100px; border:0px; overflow-y:auto;");
	}
	$.post("initFlowFormValueWrite.action",param,function(data){
		var proportyList=data.proportyList;
		for(var i=0;i<proportyList.length;i++){
			if(proportyList[i].type=='word'){
				$("#word").removeAttr("disabled");
			}else if(proportyList[i].type=='upload'){
				$("#upload").removeAttr("disabled");
			}else{
				$("#"+proportyList[i].columnName).removeAttr("disabled");
				var id=$("#"+proportyList[i].columnName);
				if($(id).is("textarea")){
					$(id).attr("tableIndex","yes");
					$(id).attr("style"," width:80%; height:100px; border:1; overflow:hidden");
					$(id).parent().append("<input type=\"button\" class=\"button_02\" onclick=\"OpenComment('"+proportyList[i].columnName+"')\" value=\"办公语\">");
					}
			}
		}
	},"json");
	formContent();
});
	
	function draftWord(val) {
		var id=$("#"+val).val();
		var url = "wordEditor.action?wordId="+id+"&proportyName="+val+"&status=2";
		openWindow(url,screen.width,screen.height);
	}
	
	function saveText(val,id){
		$("#"+val).val(id);
	}
	
	function OpenComment(msg){
		var sign="";
		var URL = "getWorkLanAll.action?location="+msg+"&message="+sign;
		openWindow(encodeURI(encodeURI(URL)),400,300);
	}
	
	function SetVerifyComment(location,message){
		var msg=$("#"+location).val();
		if(msg==''||msg=='null'){
			$("#"+location).val(message);
		}else{
			$("#"+location).val(msg+","+message);
		}
	}
function submitNextNode(id){
	var actorType=$("#actorType").val();
	if(actorType=='2'){
		getcandidateR(id);
	}else if(actorType=='3'){
		getorguserR(id);
	}else if(actorType=='5'){
		selectUser(id);
	}else {
		nextStep('');
	}
}	
	
function setValue(value,id){
	nextStep(value);
}


function formContent(){
	var tableId=$("#tableId").val();
	var formId=$("#definitionFormId").val();
	var param={"tableId":tableId,"formId":formId};
	$.post("getFormContent.action",param,function(data){
		var jsondata=data.jsonData;
		var jsonObj=eval(jsondata);
		var proportyList=data.proportyList;
		for(var i=0;i<proportyList.length;i++){
			if(proportyList[i].columnName==jsonObj[i+1].name){
				$("#"+proportyList[i].columnName).val(jsonObj[i+1].value);
			}
			if(proportyList[i].type=='upload'){
				downloadFile(proportyList[i].columnName);				
			}
		}

	},"json");
}


</script>
  </head>
  
<body>
<input type="hidden" id="userName" value="${sessionScope.userInfo.name}">
<input id="currentPage" type="hidden" value="${currentPage }">
<input id="nodeId" type="hidden"  value="${node.id}">
<input id="actorType" type="hidden" value="${node.actorType}">
<input id="definitionFormId" type="hidden" value="${definition.formId}">
<input id="tableId" type="hidden" value="${tableId}">
<form action="" method="post" name="documentForm" >
<input id="userId" type="hidden" value="${sessionScope.userInfo.id}">
<input id="flowId" type="hidden" value="${workflow.id}">
<div id="nodebutton" style="margin-left: 30px;margin-top: 10px">
		<input type="button" class="button_04" onclick="submitNextNode('${node.id}')" value="${node.name}">&nbsp;
		<input type="checkbox" value="1" name="message">短信提醒
	</div>
	${definition.content}
	<p></p>
<div align="center">
		<input type="button" class="button_04" onclick="submitNextNode('${node.id}')" value="${node.name}">&nbsp;
		<input type="checkbox" value="1" name="message">短信提醒
	</div>
</form>
</body>
</html>
